package com.redis.bean;

import java.time.LocalDateTime;
import java.util.Date;

public class MPost {

    private Long id;
    private String title;
    private Long userId;
    private Integer commentCount;
    private Integer viewCount;
    private Date created;

    // 构造方法
    public MPost() {}

    public MPost(Long id, String title, Long userId, Integer commentCount, Integer viewCount, Date created) {
        this.id = id;
        this.title = title;
        this.userId = userId;
        this.commentCount = commentCount;
        this.viewCount = viewCount;
        this.created = created;
    }

    // Getter 和 Setter 方法
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(Integer commentCount) {
        this.commentCount = commentCount;
    }

    public Integer getViewCount() {
        return viewCount;
    }

    public void setViewCount(Integer viewCount) {
        this.viewCount = viewCount;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    // toString 方法
    @Override
    public String toString() {
        return "MPost{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", userId=" + userId +
                ", commentCount=" + commentCount +
                ", viewCount=" + viewCount +
                ", created=" + created +
                '}';
    }
}
